/*
	AIBID updater
	Copyright (C) 2012-2012 Metallhead <Metallhead@megabox.ru>

	HomePage:    http://code.google.com/p/aibid/

	This program is free software: you can redistribute it and/or modify
	it under the terms of the GNU General Public License as published by
	the Free Software Foundation, either version 3 of the License, or
	(at your option) any later version.

	This program is distributed in the hope that it will be useful,
	but WITHOUT ANY WARRANTY; without even the implied warranty of
	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
	GNU General Public License for more details.

	You should have received a copy of the GNU General Public License
	along with this program.  If not, see <http://www.gnu.org/licenses/>.
*/

#include <QtGui/QApplication>
#include "mainwindow.h"
#include <QTranslator>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
	a.setOrganizationName("Anonymous");
	a.setApplicationName("AIBID");
	QSettings settings(QCoreApplication::organizationName(),QCoreApplication::applicationName());

	QTranslator myTranslator;
	myTranslator.load(QDir::toNativeSeparators(QDesktopServices::storageLocation(QDesktopServices::DataLocation) + "/translations/aibid-updater_" + settings.value("settings/currentLanguage").toString() + ".qm"));
	a.installTranslator(&myTranslator);

	QString appName = "";
	if(argc>=2)
		appName = argv[1];
	MainWindow w(appName);
	w.show();
    return a.exec();
}
